package com.marui.eight.complatefuture.help;

/**
 * @author marui
 * @version 1.0
 * @date 2021/6/13 12:02 下午
 * @since 1.0
 */
public class MyCompleteTask {

    public String doBusiness(){
        //模拟执行耗时任务
        System.out.println("task doing...");
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        //返回结果
        return "result";
    }

    public String doBusiness2(){
        //模拟执行耗时任务
        System.out.println("task doing...");
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        //返回结果
        return "result";
    }


    public String doExceptionBusiness(){
        //模拟执行耗时任务
        System.out.println("task doing...");
        try {
            Thread.sleep(3000);
            int i = 1 / 0;
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        //返回结果
        return "result";
    }
}
